package com.dgty.dg_common.ui

import android.content.Context
import com.alibaba.android.arouter.launcher.ARouter
import com.blankj.utilcode.util.ActivityUtils
import com.dgty.dg_common.bean.VideoModel
import com.dgty.dg_common.util.Constants

/**
 * Title: ActivityHelper
 * Description:
 * Created DateTime: 2023-02-23 16:31
 * Created by xxl.
 */
class ActivityHelper {
    companion object {
        //登录
        fun startLogin() {
            ARouter.getInstance().build(Constants.PATH_LOGIN).navigation()
        }
        fun startLoginMain() {
            ARouter.getInstance().build(Constants.PATH_LOGIN_MAIN).navigation()
        }

        //主页
        fun startMain() {
            ARouter.getInstance().build(Constants.PATH_MAIN).navigation()
        }

        fun startRegist() {
            ARouter.getInstance().build(Constants.PATH_REGIST).navigation()
        }

        fun startVerifyCode(email: String, type: String) {
            ARouter.getInstance().build(Constants.PATH_VERIFY).withString("email", email).withString("type", type).navigation()
        }

        fun startSetPsw(email: String, tempToken: String, type: String) {
            ARouter.getInstance().build(Constants.PATH_SETPSW).withString("email", email).withString("tempToken", tempToken).withString("type", type).navigation()
        }

        fun startForgetPsw(email: String) {
            ARouter.getInstance().build(Constants.PATH_FORGETPSW).withString("email", email).navigation()
        }

        fun startPersonInfo(hasBack:Boolean) {
            ARouter.getInstance().build(Constants.PATH_INFO).withBoolean("hasBack",hasBack).navigation()
        }
        fun startPersonInfo() {
            ARouter.getInstance().build(Constants.PATH_INFO).navigation()
        }

        fun startConfirmEmail(type: String) {
            ARouter.getInstance().build(Constants.PATH_CONFIRM_EMAIL).withString("type", type).navigation()
        }

        fun startWeight(
            nickname: String,
            headPic: String,
            gender: Int,
            birthday: String,
        ) {
            ARouter.getInstance().build(Constants.PATH_WEIGHT).withString("nickname", nickname)
                .withString("headPic", headPic)
                .withInt("gender", gender)
                .withString("birthday", birthday)
                .navigation()
        }

        //课程列表
        fun startCourseList(courseType: String) {
            ARouter.getInstance().build(Constants.PATH_COURSELIST).withString("courseType", courseType).navigation()
        }

        //训练营列表
        fun startTrainList() {
            ARouter.getInstance().build(Constants.PATH_COURSETRAINLIST).navigation()
        }

        //基础课程详情
        fun startCourseDetail(id: Int) {
            ARouter.getInstance().build(Constants.PATH_BASICCOURSEDETAIL).withInt("CoursePoster.id", id).navigation()
        }

        //训练营列表详情
        fun startTrainCourseDetail(id: Int) {
            ARouter.getInstance().build(Constants.PATH_TRAINCOURSEDETAIL).withInt("CoursePoster.id", id).navigation()
        }

        //游戏详情
        fun startGameDetail(id: Int) {
            ARouter.getInstance().build(Constants.PATH_GAMEDETAIL).withInt("game.id", id).navigation()
        }

    /*    //训练营播放器
        fun startTrainPlayer( urllist: ArrayList<VideoModel>, courseId: Long) {
            ARouter.getInstance().build(Constants.PATH_TRAINPLAYER).withLong("courseId", courseId).withParcelableArrayList("urllist", urllist).navigation(mContext,Constants.REQUEST_TRAIN_PLAYER)
        }*/

        //排行榜
        fun startRankList() {
            ARouter.getInstance().build(Constants.PATH_RANKING_LIST).navigation()
        }

        //反馈列表
        fun startFeedBack() {
            ARouter.getInstance().build(Constants.PATH_FEEDBACK_LIST).navigation()
        }

        //反馈编辑
        fun startFeedBackEdit() {
            ARouter.getInstance().build(Constants.PATH_FEEDBACK_ADDREPLY)
                .withBoolean("isAdd", true).navigation()
        }

        //训练结果页
        fun startTrainResult(trainRecordId: Int) {
            ARouter.getInstance().build(Constants.PATH_TRAINRESULT).withInt("trainRecordId", trainRecordId).navigation()
        }

        //跳转Web  direction 游戏屏幕方向 1横屏，2竖屏
        fun startGameWeb(url: String, direction: Int) {
            ARouter.getInstance().build(Constants.PATH_WEB)
                .withString(Constants.WEB_LINK, url)
                .withInt(Constants.WEB_DIRECTION, direction)
                .navigation()
        }
        fun startWeb(url: String) {
            ARouter.getInstance().build(Constants.PATH_COMMON_WEB)
                .withString(Constants.WEB_LINK, url)
                .navigation()
        }

    }
}